package com.lagou.bus.controller;

import com.lagou.pojo.User;
import com.lagou.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName RpcController
 * @Description
 * @Author playboy
 * @Date 2021/6/5 4:07 下午
 * @Version 1.0
 **/
@RestController
public class RpcController {

	@Autowired
	private IUserService userService;

	@RequestMapping("/rpc/user/{userId}")
	public User getUser(@PathVariable("userId") int userId) {
		User user = userService.getById(userId);
		return user;
	}
}
